
'use strict';

/**
	Part of Zombie Navigator
	Copyright © 2015  Zombie Navigator Developers
	
	@file
	@module
	@license AGPL-3.0+
*/


/* Exported APIs */
Object.freeze(Object.getPrototypeOf(function () {}));

/**
	@public
*/
const getConsole = () => {
	return new Proxy(Object.create(null), {get (o, key) {
		const date = `[${(new Date).toISOString()}]`;
		
		if ('object' != typeof console) {
			if ('function' == typeof dump) {
				return dump.bind(null, date);
			}
			
			return function () {};
		}
		
		if ('function' == typeof console[key]) {
			return console[key].bind(console, date);
		}
		
		if ('function' == typeof console.log) {
			return console.log.bind(console, key + ':', date);
		}
		
		return function () {};
	}});
};


/* Exports */
exports.getConsole = getConsole;


// vim: ts=4 noet ai

